<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>开发</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css"/>
    <link rel="stylesheet" type="text/css" href="../css/style.css"/>
    <link rel="stylesheet" type="text/css" href="../css/aui.css"/>
    <style>
        .empty{ text-align: center; padding: 120px 0; }
    </style>
</head>
<body>
    <div id='app' class="aui-card-list">
            <div class="aui-card-list-header">
                <div><i class="aui-iconfont aui-icon-my aui-text-danger"></i><span class="aui-text-danger"> 我的学生</span></div>
                <i class="aui-iconfont aui-icon-more"></i>
            </div>
            <div class="aui-card-list-content">
                <ul class="aui-list aui-media-list">
                    <li v-for="item in students" class="aui-list-item aui-list-item-middle">
                        <div class="aui-media-list-item-inner">
                            <div class="aui-list-item-media" style="width: 3rem;">
                                <img src="../image/demo5.png" class="aui-img-round" >
                            </div>
                            <div class="aui-list-item-inner aui-list-item-arrow">
                                <div class="aui-list-item-text">
                                    <div class="aui-list-item-title aui-font-size-14">{{item.username}}</div>
                                    <div class="aui-list-item-right">{{item.usercreatetime}}</div>
                                </div>
                                <div class="aui-list-item-text">
                                    学号：{{item.userid}}
                                </div>
                            </div>
                        </div>
                    </li>

                </ul>
            </div>

        </div>
        <script type="text/javascript" src="../script/api.js"></script>
        <script type="text/javascript" src="../script/vue.js"></script>
        <script type="text/javascript" src="../script/jquery-1.12.4.min.js"></script>
        <script type="text/javascript" src="../layer/layer.js"></script>
        <script type="text/javascript" src="../script/init.js" ></script>
        <script type="text/javascript">
        var user = JSON.parse(localStorage.getItem('user'))
          var app = new Vue({
            el:'#app',
            data:{
              students:[]

            },
            created: function () {
              this.getStudents()

            },
            methods:{
              getStudents(){
                $.ajax({
                url:bashUrl+`students/${user.userid}`,
                type:"get",
                data:{},
                timeout:3000,
                dataType:"json",
                success:(data)=>{
                  this.students = data.users
                },
                error: function () {

                  api.toast({msg:"请求超时或繁忙",duration : 2000})
                }
                });
              }

            }

          })
        </script>


</body>
</html>
